
安卓开发中,从SD卡上图片载入的Bitmap对象默认是只读的,如果妳对它做setPixels操作就会引发异常。解决方法是,使用 Bitmap.copy(Bitmap.Config config, boolean isMutable)从原来的 Bitmap对象里复制出一个可写的Bitmap.
http://stackoverflow.com/questions/6764839/error-with-setpixels
亮点 :
| 
      15 down vote accepted  | 
    
      I think your Bitmap is not mutable (see setPixel()'s documentation). If so, create a mutable copy of this Bitmap (using Bitmap.copy(Bitmap.Config config, boolean isMutable) as an example) and work on this one. 
  | 
   ||
未知美人
HxLauncher: Launch Android applications by voice commands